/*
	Author      : Sidek Sirun
	Course      : UCI Java Programming I (X460.10)
	Assignment 3: Person class
	
		Object:
			Person
		State:
			1. First Name
			2. Last Name
			3. Age
			4. Gender
			5. SSN
		Behavior:
			1. Determine full name
			2. Determine age
			3. Determine gender
			4. Determine SSN
			5. Talk
*/

public class Person {
	// Variables (State of the Person object)
	private String  firstName;
	private String  lastName;
	//private String  fullName;
	private int     age;
	private String  gender;
	private String  ssn;

	// Constructors (initialize the variables)
	public Person(String firstName, String lastName, int age, String gender, String ssn) {
		this.firstName = firstName;
		this.lastName  = lastName;
		this.age       = age;
		this.gender    = gender;
		this.ssn       = ssn;
	}

	// Methods
	/**
	* @param firstName
	*/
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	/**
	* @return firstName
	*/
	public String getFirstName() {
		return firstName;
	}

	/**
	* @param lastName
	*/
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	/**
	* @return lastName
	*/
	public String getLastName() {
		return lastName;
	}

	/**
	*	@return fullName
	*/
	public String getFullName() {
		String fullName = getFirstName() + ' ' + getLastName();
		return fullName;
	}

	/**
	* @param age
	*/
	public void setAge(int age) {
		this.age = age;
	}
	/**
	* @return age
	*/
	public int getAge() {
		return age;
	}

	/**
	* @param ssn
	*/
	public void setSSN(String ssn) {
		this.ssn = ssn;
	}
	/**
	* @return ssn
	*/
	public String getSSN() {
		return ssn;
	}

	/**
	* @param gender
	*/
	public void setGender(String gender) {
		this.gender = gender;
	} 

	/**
	* @preturn gender
	*/
	public String getGender() {
		return gender;
	}
	
	/**
	* @return talk
	*/
	public String talk() {
		String reply = "Hello. My name is " + getFullName() + ".";
		reply        = reply + " " + "I'm " + getAge() + " years old.";
		return reply;
	}

	/**
	* @return personInfo
	*/
	public String getPersonInfo() {
		String  fullName  = getFullName();
		int     age       = getAge();
		String  gender    = getGender();
		String  ssn       = getSSN();

		String personInfo = "Full Name: " + fullName + ", Age: " + age + ", Gender: " + gender + ", SSN: " + ssn;
		return personInfo;
	}

	/**
	* @return personInfo
	* toString() is another method to return personInfo
	*/
	public String toString() {
		String fullName   = getFullName();
		String personInfo = "Full Name: " + fullName + ", Age: " + age + ", Gender: " + gender + ", SSN: " + ssn;
		return personInfo;
	}

}